package com.eastfair.venuebooking.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.mapper.SuperMapper;
import com.eastfair.venuebooking.entity.Contact;

import com.eastfair.venuebooking.entity.CustomerMain;
import com.eastfair.venuebooking.vo.ContactVO;
import com.eastfair.venuebooking.vo.CustomerMainVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * 客户及线索联系人表
 * </p>
 *
 * @author linan
 * @date 2022-06-08
 */
@Repository
public interface ContactMapper extends SuperMapper<Contact> {

    /**
     * 分页查询联系人列表.
     *
     * @param page         the page
     * @param queryWrapper the query wrapper
     * @return the page
     */
    IPage<ContactVO> listContactVOs(IPage<Contact> page,
                                   @Param(Constants.WRAPPER) QueryWrapper<Contact> queryWrapper);

    /**
     * 客户ID统计联系人数量.
     *
     * @param customerId the customer id
     * @return the long
     */
    long countContactByCustomerId(@Param("customerId") Long customerId);

}
